import pytest
from app import create_app, db


@pytest.fixture("function")
def flask_app():
    app = create_app("testing")
    ctx = app.app_context()
    ctx.push()
    db.create_all()
    yield app
    db.session.remove()
    db.drop_all()
    ctx.pop()
